#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFile>
#include <QFileDialog>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QThread>
#include <QMessageBox>
#include <QSettings>
#include "qdownloadhandler.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QDownloadHandler* downloader;
    QThread* thread;

signals:
    void isp();

private slots:
    void selectFile();
    void download();
    void downlaodError(QString msg);
    void downlaodInfo(QString msg);

protected:
    bool eventFilter(QObject *watched, QEvent *event);
};

#endif // MAINWINDOW_H
